package data;

import java.util.Vector;

import org.restlet.resource.ClientResource;

import restlet.interfaces.BenCatsResourceI;
import beans.BenCatBean;

public class AddBenCats {

	public static void main(String[] args) {

		//final String URL = "localhost:8888"; 
		final String URL = "idemdo.appspot.com"; 
		
		ClientResource cr = new ClientResource("http://" + URL + "/rest/benCats");
		BenCatsResourceI benCatResource = cr.wrap(BenCatsResourceI.class);
		System.out.println("Saljemo kateogorije povlastice...");

		Vector<BenCatBean> benCats = new Vector<BenCatBean>();
		
		benCats.add(new BenCatBean("Student"));
		benCats.add(new BenCatBean("Novinar"));
		benCats.add(new BenCatBean("Penzioner"));
		
		System.out.println("Ucitano: " + benCats.size() + " kategorija povlastice");

		int i=0;
		for(BenCatBean benCat : benCats){
			System.out.println("(" + i + ")" + "Dodajemo: " + benCat);
			benCatResource.addBenCat(benCat);
			i++;
		}
		
	}

}
